Removed the broken --enable-canvas-pixbuf option. Added the stuff
authorFederico Mena Quintero <federico@helixcode.com>
Mon, 17 Jan 2000 01:48:21 +0000 (01:48 +0000)
committerArturo Espinosa <unammx@src.gnome.org>
Mon, 17 Jan 2000 01:48:21 +0000 (01:48 +0000)
2000-01-16  Federico Mena Quintero  <federico@helixcode.com>

* configure.in: Removed the broken --enable-canvas-pixbuf option.
Added the stuff necessary to substitute the variables in
gnomecanvaspixbufConf.sh.in.

* gnomecanvaspixbufConf.sh.in: New gnome-config handler for the
tiny gnomecanvaspixbuf library.

* Makefile.am: Build gnomecanvaspixbufConf.sh.

* gdk-pixbuf/Makefile.am: Create a libgnomecanvaspixbuf and only
build it if gdk-pixbuf is being built outside of gnome-libs.

* doc/gdk-pixbuf-sections.txt: Added gdk_pixbuf_render_pixmap_and_mask().

* gdk-pixbuf/gdk-pixbuf-render.c
(gdk_pixbuf_render_pixmap_and_mask): Renamed from
gdk_pixbuf_render_pixmap().  Do not create the mask if it is not
needed, and do not use a clipping mask when rendering the pixmap.
Tweaked documentation a little.

* HACKING: New file with hacking policies for the gdk-pixbuf
module.

* doc/Makefile.am (tmpl_sources): Added missing backslash.

* doc/Makefile.am: Use gnomecanvaspixbuf in gnome-config when
scanning for docstrings.

* gdk-pixbuf/gdk-pixbuf-util.c (gdk_pixbuf_copy_area): Made sanity
checks more stringent.  Removed "gint" abominations.  Made
documentation consistent with the rest of the functions.

* doc/gdk-pixbuf-sections.txt: Added gdk_pixbuf_copy_area() to the
utilities section.

16 files changed:
docs/reference/gdk-pixbuf/Makefile.am
docs/reference/gdk-pixbuf/gdk-pixbuf-decl.txt
docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt
docs/reference/gdk-pixbuf/gdk-pixbuf.args
docs/reference/gdk-pixbuf/gdk-pixbuf.signals
docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-loader.sgml
docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml
docs/reference/gdk-pixbuf/tmpl/gnome-canvas-pixbuf.sgml
docs/reference/gdk-pixbuf/tmpl/rendering.sgml
docs/reference/gdk-pixbuf/tmpl/scaling.sgml
docs/reference/gdk-pixbuf/tmpl/util.sgml
gdk-pixbuf/ChangeLog
gdk-pixbuf/Makefile.am
gdk-pixbuf/gdk-pixbuf-util.c
gdk-pixbuf/gdk-pixbuf.h
gdk/gdkpixbuf-render.c

index b66ecede0042bd3d01ea9ee615a92388c60be4d2..eef777148eaab079c15ea62b5131603ab9636cc3 100644 (file)
@@ -9,15 +9,15 @@ DOC_MAIN_SGML_FILE=gdk-pixbuf.sgml
 # The directory containing the source code (if it contains documentation).
 DOC_SOURCE_DIR=$(GDK_PIXBUF_DIR)/gdk-pixbuf
 
-CFLAGS=`gnome-config --cflags gnomeui gdk_pixbuf`
-LDFLAGS=`gnome-config --libs gnomeui gdk_pixbuf`
+CFLAGS=`gnome-config --cflags gnomeui gdk_pixbuf gnomecanvaspixbuf`
+LDFLAGS=`gnome-config --libs gnomeui gdk_pixbuf gnomecanvaspixbuf`
 
 HTML_DIR=$(datadir)/gnome/html
 
 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
 
 tmpl_sources =                                 \
-       tmpl/animation.sgml
+       tmpl/animation.sgml                     \
        tmpl/creating.sgml                      \
        tmpl/file-loading.sgml                  \
        tmpl/from-drawables.sgml                \
index 884c3247b6d19572e70ebbb82030700009c55677..b85363d39a74bbf7a76dbc6af1e5a55b82191fca 100644 (file)
@@ -14,8 +14,7 @@ GdkPixbuf *pixbuf,
 <USER_FUNCTION>
 <NAME>ModuleFrameDoneNotifyFunc</NAME>
 <RETURNS>void </RETURNS>
-GdkPixbuf *pixbuf,
-                                           gint frame,
+GdkPixbufFrame *frame,
                                            gpointer user_data
 </USER_FUNCTION>
 <USER_FUNCTION>
@@ -286,11 +285,21 @@ GdkPixbuf *pixbuf,GdkDrawable *drawable, GdkGC *gc,int src_x, int src_y,int dest
 GdkPixbuf *pixbuf, GdkDrawable *drawable,int src_x, int src_y,int dest_x, int dest_y,int width, int height,GdkPixbufAlphaMode alpha_mode,int alpha_threshold,GdkRgbDither dither,int x_dither, int y_dither
 </FUNCTION>
 <FUNCTION>
+<NAME>gdk_pixbuf_render_pixmap_and_mask</NAME>
+<RETURNS>void  </RETURNS>
+GdkPixbuf *pixbuf,GdkPixmap **pixmap_return, GdkBitmap **mask_return,int alpha_threshold
+</FUNCTION>
+<FUNCTION>
 <NAME>gdk_pixbuf_get_from_drawable</NAME>
 <RETURNS>GdkPixbuf  *</RETURNS>
 GdkPixbuf *dest,GdkDrawable *src, GdkColormap *cmap,int src_x, int src_y,int dest_x, int dest_y,int width, int height
 </FUNCTION>
 <FUNCTION>
+<NAME>gdk_pixbuf_copy_area</NAME>
+<RETURNS>void  </RETURNS>
+GdkPixbuf *src_pixbuf,int src_x, int src_y,int width, int height,GdkPixbuf *dest_pixbuf,int dest_x, int dest_y
+</FUNCTION>
+<FUNCTION>
 <NAME>gdk_pixbuf_scale</NAME>
 <RETURNS>void  </RETURNS>
 GdkPixbuf      *src,GdkPixbuf      *dest,int             dest_x,int             dest_y,int             dest_width,int             dest_height,double          offset_x,double          offset_y,double          scale_x,double          scale_y,ArtFilterLevel  filter_level
@@ -330,6 +339,16 @@ GdkPixbufAnimation *animation
 <RETURNS>void  </RETURNS>
 GdkPixbufAnimation *animation
 </FUNCTION>
+<FUNCTION>
+<NAME>gdk_pixbuf_preinit</NAME>
+<RETURNS>void  </RETURNS>
+gpointer app, gpointer modinfo
+</FUNCTION>
+<FUNCTION>
+<NAME>gdk_pixbuf_postinit</NAME>
+<RETURNS>void  </RETURNS>
+gpointer app, gpointer modinfo
+</FUNCTION>
 <MACRO>
 <NAME>GNOME_TYPE_CANVAS_PIXBUF</NAME>
 #define GNOME_TYPE_CANVAS_PIXBUF            (gnome_canvas_pixbuf_get_type ())
@@ -373,3 +392,23 @@ struct GnomeCanvasPixbuf {
 <RETURNS>GtkType  </RETURNS>
 void
 </FUNCTION>
+<MACRO>
+<NAME>GDK_PIXBUF_MAJOR</NAME>
+#define GDK_PIXBUF_MAJOR (0)
+</MACRO>
+<MACRO>
+<NAME>GDK_PIXBUF_MINOR</NAME>
+#define GDK_PIXBUF_MINOR (4)
+</MACRO>
+<MACRO>
+<NAME>GDK_PIXBUF_MICRO</NAME>
+#define GDK_PIXBUF_MICRO (0)
+</MACRO>
+<MACRO>
+<NAME>GDK_PIXBUF_VERSION</NAME>
+#define GDK_PIXBUF_VERSION "0.4.0"
+</MACRO>
+<VARIABLE>
+<NAME>gdk_pixbuf_version</NAME>
+extern const char *gdk_pixbuf_version;
+</VARIABLE>
index 7de064ea7457a95ae2054018ee905d2002f378af..82673441b5bed4f26147972ed605f1c9f7d1008e 100644 (file)
@@ -38,6 +38,7 @@ GdkPixbufAlphaMode
 gdk_pixbuf_render_to_drawable_alpha
 gdk_pixbuf_render_to_drawable
 gdk_pixbuf_render_threshold_alpha
+gdk_pixbuf_render_pixmap_and_mask
 </SECTION>
 
 <SECTION>
@@ -48,6 +49,7 @@ gdk_pixbuf_get_from_drawable
 <SECTION>
 <FILE>util</FILE>
 gdk_pixbuf_add_alpha
+gdk_pixbuf_copy_area
 </SECTION>
 
 <SECTION>
index b212136dca410aced5ae7ce08b75d901ff7a03ba..8813bd7b35656bdd700e69a309e6c41dc7d31687 100644 (file)
@@ -17,7 +17,7 @@
 </ARG>
 
 <ARG>
-<NAME>GnomeCanvasPixbuf::width_pixels</NAME>
+<NAME>GnomeCanvasPixbuf::width_in_pixels</NAME>
 <TYPE>gboolean</TYPE>
 <FLAGS>rw</FLAGS>
 </ARG>
@@ -35,7 +35,7 @@
 </ARG>
 
 <ARG>
-<NAME>GnomeCanvasPixbuf::height_pixels</NAME>
+<NAME>GnomeCanvasPixbuf::height_in_pixels</NAME>
 <TYPE>gboolean</TYPE>
 <FLAGS>rw</FLAGS>
 </ARG>
@@ -53,7 +53,7 @@
 </ARG>
 
 <ARG>
-<NAME>GnomeCanvasPixbuf::x_pixels</NAME>
+<NAME>GnomeCanvasPixbuf::x_in_pixels</NAME>
 <TYPE>gboolean</TYPE>
 <FLAGS>rw</FLAGS>
 </ARG>
@@ -71,7 +71,7 @@
 </ARG>
 
 <ARG>
-<NAME>GnomeCanvasPixbuf::y_pixels</NAME>
+<NAME>GnomeCanvasPixbuf::y_in_pixels</NAME>
 <TYPE>gboolean</TYPE>
 <FLAGS>rw</FLAGS>
 </ARG>
index d53d607821b501015ec15ab0781d93c11c5dbc0c..7ac8646deaee5f60e9e8b59755feb738d93b49fc 100644 (file)
@@ -14,6 +14,18 @@ gint  arg4
 GdkPixbufLoader *gdkpixbufloader
 </SIGNAL>
 
+<SIGNAL>
+<NAME>GdkPixbufLoader::frame-done</NAME>
+<RETURNS>void</RETURNS>
+GdkPixbufLoader *gdkpixbufloader
+</SIGNAL>
+
+<SIGNAL>
+<NAME>GdkPixbufLoader::animation-done</NAME>
+<RETURNS>void</RETURNS>
+GdkPixbufLoader *gdkpixbufloader
+</SIGNAL>
+
 <SIGNAL>
 <NAME>GdkPixbufLoader::closed</NAME>
 <RETURNS>void</RETURNS>
index e1529370070844ceb7fdd48875855000323036ef..ed5a432cf5efc9558562242d1989a1d5bbf6e0f1 100644 (file)
@@ -54,6 +54,7 @@ Application-driven progressive image loading.
       frames are done.
     </para>  
   </refsect2>
+
 <!-- ##### SECTION See_Also ##### -->
   <para>
     gdk_pixbuf_new_from_file()
@@ -146,6 +147,20 @@ Application-driven progressive image loading.
 <!-- # Unused Parameters # -->
 @loader: Loader which emitted the signal.
 
+<!-- ##### SIGNAL GdkPixbufLoader::frame-done ##### -->
+<para>
+
+</para>
+
+@gdkpixbufloader: the object which received the signal.
+
+<!-- ##### SIGNAL GdkPixbufLoader::animation-done ##### -->
+<para>
+
+</para>
+
+@gdkpixbufloader: the object which received the signal.
+
 <!-- ##### SIGNAL GdkPixbufLoader::closed ##### -->
   <para>
     This signal is emitted when gdk_pixbuf_loader_close() is called.
index 389771cf3f9f061566f6a97927be6cc13219bfe6..6f44cdc6b5baf2e3eb737715ea76846804d6f6c2 100644 (file)
@@ -1,14 +1,3 @@
-<!-- ##### ARG GnomeCanvasPixbuf:width_in_pixels ##### -->
-  <para>
-    If this argument is %TRUE, then the width of the pixbuf will be
-    considered to be in pixels, that is, it will not be visually
-    scaled even if the item's affine transformation changes.  If this
-    is %FALSE, then the width of the pixbuf will be considered to be
-    in canvas units, and so will be scaled normally by affine
-    transformations.  The default is %FALSE.
-  </para>
-
-
 <!-- ##### SECTION ./tmpl/gdk-pixbuf-io.sgml:See_Also ##### -->
 <para>
 
 
 
 
-<!-- ##### ARG GnomeCanvasPixbuf:height_in_pixels ##### -->
-  <para>
-    Works in the same way as the <link
-    linkend="GnomeCanvasPixbuf--width-in-pixels">width_in_pixels</link>
-    argument.  The default is %FALSE.
-  </para>
+<!-- ##### ARG GnomeCanvasPixbuf:height_pixels ##### -->
+<para>
+
+</para>
 
 
 <!-- ##### STRUCT GdkPixbufModule ##### -->
 @stop_load: 
 @load_increment: 
 
-<!-- ##### ARG GnomeCanvasPixbuf:y_in_pixels ##### -->
-  <para>
-    Works in the same way as the <link
-    linkend="GnomeCanvasPixbuf--x-in-pixels">x_in_pixels</link>
-    argument.  The default is %FALSE.
-  </para>
+<!-- ##### ARG GnomeCanvasPixbuf:y_pixels ##### -->
+<para>
 
-<!--
-Local variables:
-mode: sgml
-sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
-End:
--->
+</para>
 
 
 <!-- ##### SECTION ./tmpl/gdk-pixbuf-io.sgml:Long_Description ##### -->
@@ -93,6 +71,12 @@ gdk-pixbuf-io
 @pixbuf: 
 @user_data: 
 
+<!-- ##### ARG GnomeCanvasPixbuf:x_pixels ##### -->
+<para>
+
+</para>
+
+
 <!-- ##### FUNCTION gdk_pixbuf_get_module ##### -->
 <para>
 
@@ -102,14 +86,9 @@ gdk-pixbuf-io
 @size: 
 @Returns: 
 
-<!-- ##### ARG GnomeCanvasPixbuf:x_in_pixels ##### -->
-  <para>
-    If this argument is %TRUE, the pixbuf's translation with respect
-    to its logical origin in item-relative coordinates will be in
-    pixels, that is, the visible offset will not change even if the
-    item's affine transformation changes.  If it is %FALSE, the
-    pixbuf's translation will be taken to be in canvas units, and thus
-    will change along with the item's affine transformation.
-  </para>
+<!-- ##### ARG GnomeCanvasPixbuf:width_pixels ##### -->
+<para>
+
+</para>
 
 
index cd2116528bb95c2be1ad9291fe01f85d79801dc8..fd5d97e5bfb04a85ef56d24fc3e972423dfb6f1f 100644 (file)
@@ -234,10 +234,15 @@ Canvas item to display #GdkPixbuf images.
     used instead.  This argument is %FALSE by default.
   </para>
 
-<!-- ##### ARG GnomeCanvasPixbuf:width_pixels ##### -->
-<para>
-
-</para>
+<!-- ##### ARG GnomeCanvasPixbuf:width_in_pixels ##### -->
+  <para>
+    If this argument is %TRUE, then the width of the pixbuf will be
+    considered to be in pixels, that is, it will not be visually
+    scaled even if the item's affine transformation changes.  If this
+    is %FALSE, then the width of the pixbuf will be considered to be
+    in canvas units, and so will be scaled normally by affine
+    transformations.  The default is %FALSE.
+  </para>
 
 <!-- ##### ARG GnomeCanvasPixbuf:height ##### -->
   <para>
@@ -258,10 +263,12 @@ Canvas item to display #GdkPixbuf images.
     The default is %FALSE.
   </para>
 
-<!-- ##### ARG GnomeCanvasPixbuf:height_pixels ##### -->
-<para>
-
-</para>
+<!-- ##### ARG GnomeCanvasPixbuf:height_in_pixels ##### -->
+  <para>
+    Works in the same way as the <link
+    linkend="GnomeCanvasPixbuf--width-in-pixels">width_in_pixels</link>
+    argument.  The default is %FALSE.
+  </para>
 
 <!-- ##### ARG GnomeCanvasPixbuf:x ##### -->
   <para>
@@ -280,10 +287,15 @@ Canvas item to display #GdkPixbuf images.
     coordinates.
   </para>
 
-<!-- ##### ARG GnomeCanvasPixbuf:x_pixels ##### -->
-<para>
-
-</para>
+<!-- ##### ARG GnomeCanvasPixbuf:x_in_pixels ##### -->
+  <para>
+    If this argument is %TRUE, the pixbuf's translation with respect
+    to its logical origin in item-relative coordinates will be in
+    pixels, that is, the visible offset will not change even if the
+    item's affine transformation changes.  If it is %FALSE, the
+    pixbuf's translation will be taken to be in canvas units, and thus
+    will change along with the item's affine transformation.
+  </para>
 
 <!-- ##### ARG GnomeCanvasPixbuf:y ##### -->
   <para>
@@ -302,8 +314,17 @@ Canvas item to display #GdkPixbuf images.
     default is %FALSE.
   </para>
 
-<!-- ##### ARG GnomeCanvasPixbuf:y_pixels ##### -->
-<para>
+<!-- ##### ARG GnomeCanvasPixbuf:y_in_pixels ##### -->
+  <para>
+    Works in the same way as the <link
+    linkend="GnomeCanvasPixbuf--x-in-pixels">x_in_pixels</link>
+    argument.  The default is %FALSE.
+  </para>
 
-</para>
+<!--
+Local variables:
+mode: sgml
+sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
+End:
+-->
 
index 09afa8c65900d93c985063f723b12fa9d1328bf8..20365ab3c2aa62d5407f1e89b1ed7cff29264d3f 100644 (file)
@@ -115,3 +115,14 @@ End:
 -->
 
 
+<!-- ##### FUNCTION gdk_pixbuf_render_pixmap_and_mask ##### -->
+<para>
+
+</para>
+
+@pixbuf: 
+@pixmap_return: 
+@mask_return: 
+@alpha_threshold: 
+
+
index 153a5cf431c0e5eac8bdeee3b0e4f2be030d888b..37411cd4f75856b24c0ba2970aaefc7259cb37e8 100644 (file)
@@ -152,11 +152,11 @@ expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
 @check_size: 
 @color1: 
 @color2: 
-@Returns: 
-
-<!--
+@Returns: <!--
 Local variables:
 mode: sgml
 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
 End:
--->
\ No newline at end of file
+-->
+
+
index f84edb50e0b274166fa325722a6c60ad27ada1a6..2d29c750540d12bb2adf8d3c4459d20b16bf4d93 100644 (file)
@@ -35,3 +35,18 @@ End:
 -->
 
 
+<!-- ##### FUNCTION gdk_pixbuf_copy_area ##### -->
+<para>
+
+</para>
+
+@src_pixbuf: 
+@src_x: 
+@src_y: 
+@width: 
+@height: 
+@dest_pixbuf: 
+@dest_x: 
+@dest_y: 
+
+
index 1d63ea699bdef0a8dbec1851a05c830799f410ad..761097662a505a21d51c53766232dec0bbe430da 100644 (file)
@@ -1,8 +1,40 @@
-2000-01-15  Federico Mena Quintero  <federico@helixcode.com>
+2000-01-16  Federico Mena Quintero  <federico@helixcode.com>
+
+       * configure.in: Removed the broken --enable-canvas-pixbuf option.
+       Added the stuff necessary to substitute the variables in
+       gnomecanvaspixbufConf.sh.in.
+
+       * gnomecanvaspixbufConf.sh.in: New gnome-config handler for the
+       tiny gnomecanvaspixbuf library.
+
+       * Makefile.am: Build gnomecanvaspixbufConf.sh.
+
+       * gdk-pixbuf/Makefile.am: Create a libgnomecanvaspixbuf and only
+       build it if gdk-pixbuf is being built outside of gnome-libs.
+
+       * doc/gdk-pixbuf-sections.txt: Added gdk_pixbuf_render_pixmap_and_mask().
+
+       * gdk-pixbuf/gdk-pixbuf-render.c
+       (gdk_pixbuf_render_pixmap_and_mask): Renamed from
+       gdk_pixbuf_render_pixmap().  Do not create the mask if it is not
+       needed, and do not use a clipping mask when rendering the pixmap.
+       Tweaked documentation a little.
 
        * HACKING: New file with hacking policies for the gdk-pixbuf
        module.
 
+       * doc/Makefile.am (tmpl_sources): Added missing backslash.
+
+       * doc/Makefile.am: Use gnomecanvaspixbuf in gnome-config when
+       scanning for docstrings.
+
+       * gdk-pixbuf/gdk-pixbuf-util.c (gdk_pixbuf_copy_area): Made sanity
+       checks more stringent.  Removed "gint" abominations.  Made
+       documentation consistent with the rest of the functions.
+
+       * doc/gdk-pixbuf-sections.txt: Added gdk_pixbuf_copy_area() to the
+       utilities section.
+
 2000-01-14  Jonathan Blandford  <jrb@redhat.com>
 
        * gdk-pixbuf/gdk-pixbuf-render.c (gdk_pixbuf_render_pixmap): new
 
        * configure.in, gdk-pixbuf/Makefile.am: Build a libcanvas_pixbuf.
 
-       * configure.in: Define version macros. Generate gdk-pixbuf/gdk-pixbuf-features.h. Always INSIDE_GNOME.
+       * configure.in: Define version macros. Generate
+       gdk-pixbuf/gdk-pixbuf-features.h. Always INSIDE_GNOME.
+
        * gdk-pixbuf/Makefile.am: Add gdk-pixbuf-features.h
-       * gdk-pixbuf/gdk-pixbuf.c: Add definitions of gdk-pixbuf-features.h declarations, plus some initialization stubs.
+
+       * gdk-pixbuf/gdk-pixbuf.c: Add definitions of
+       gdk-pixbuf-features.h declarations, plus some initialization
+       stubs.
 
 2000-01-05  Owen Taylor  <otaylor@redhat.com>
 
index 20ae6888bc1727d02ca4ef97d99fe0dea2d84e6f..600408bdc153cffea682314a2d8b5c24666443fd 100644 (file)
@@ -1,16 +1,21 @@
 SUBDIRS = pixops
 
-if CANVAS_PIXBUF
-CPLIB=libcanvas_pixbuf.la
-libcanvas_pixbuf_la_SOURCES=gnome-canvas-pixbuf.c
-CANVAS_HEADERFILES=gnome-canvas-pixbuf.h
+if INSIDE_GNOME_LIBS
+CANVAS_PIXBUF_LIB =
+CANVAS_PIXBUF_HEADERFILES =
+EXTRA_GNOME_LIBS =
 else
-CPLIB=
-CANVAS_HEADERFILES=
+CANVAS_PIXBUF_LIB = libgnomecanvaspixbuf.la
+CANVAS_PIXBUF_HEADERFILES=gnome-canvas-pixbuf.h
+EXTRA_GNOME_LIBS = $(GNOME_LIBS)
 endif
+
 lib_LTLIBRARIES =              \
        libgdk_pixbuf.la        \
-       $(CPLIB)
+       $(CANVAS_PIXBUF_LIB)
+
+libgnomecanvaspixbuf_la_SOURCES = gnome-canvas-pixbuf.c
+libgnomecanvaspixbuf_la_LDFLAGS = $(EXTRA_GNOME_LIBS)
 
 libexecdir = $(libdir)/gdk-pixbuf/loaders
 
@@ -58,9 +63,10 @@ INCLUDES = -I$(top_srcdir) -I$(top_builddir) \
        $(GLIB_CFLAGS) $(LIBART_CFLAGS) $(GTK_CFLAGS)
 AM_CPPFLAGS = "-DPIXBUF_LIBDIR=\"$(libexecdir)\""
 
+if INSIDE_GNOME_LIBS
 LDADDS = libgdk_pixbuf.la $(LIBART_LIBS) $(GLIB_LIBS) $(GTK_LIBS)
-
-if CANVAS_PIXBUF
+else
+LDADDS = libgdk_pixbuf.la libgnomecanvaspixbuf.la $(LIBART_LIBS) $(GLIB_LIBS) $(GTK_LIBS)
 endif
 
 if INSIDE_GNOME_LIBS
@@ -81,13 +87,6 @@ GDK_PIXBUF_LIBS = $(LIBART_LIBS) $(GLIB_LIBS) $(GTK_LIBS)
 #
 # The GdkPixBuf library
 #
-if INSIDE_GNOME_LIBS
-CANVAS_SOURCEFILES=
-CANVAS_HEADERFILES=
-else
-CANVAS_SOURCEFILES=    gnome-canvas-pixbuf.c
-CANVAS_HEADERFILES=    gnome-canvas-pixbuf.h
-endif
 
 libgdk_pixbufincludedir = $(includedir)/gdk-pixbuf
 
@@ -100,24 +99,16 @@ libgdk_pixbuf_la_SOURCES =         \
        gdk-pixbuf-loader.c     \
        gdk-pixbuf-render.c     \
        gdk-pixbuf-scale.c      \
-       gdk-pixbuf-util.c       \
-       $(CANVAS_SOURCEFILES)
-
-if INSIDE_GNOME_LIBS
-EXTRA_GNOME_LIBS = ""
-else
-EXTRA_GNOME_LIBS = $(GNOME_LIBS)
-endif
+       gdk-pixbuf-util.c
 
 libgdk_pixbuf_la_LDFLAGS = -version-info 1:0:0 $(EXTRA_GNOME_LIBS)
 libgdk_pixbuf_la_LIBADD = pixops/libpixops.la
 
-
 libgdk_pixbufinclude_HEADERS = \
        gdk-pixbuf.h            \
        gdk-pixbuf-loader.h     \
        gdk-pixbuf-features.h   \
-       $(CANVAS_HEADERFILES)
+       $(CANVAS_PIXBUF_HEADERFILES)
 
 noinst_HEADERS = \
        gdk-pixbuf-io.h
index 2bc7e98b06f165ac74b2b7d14bf6d84d0fcbaee5..36dbed13cd9646c6c4dcafb6035743a4a8662857 100644 (file)
@@ -97,58 +97,47 @@ gdk_pixbuf_add_alpha (GdkPixbuf *pixbuf, gboolean substitute_color, guchar r, gu
 
 /**
  * gdk_pixbuf_copy_area:
- * @src_pixbuf: The pixbuf to be copied.
- * @src_x: The X coordinate of the upper left corner of the area to copy.
- * @src_y: The Y coordinate of the upper left corner of the area to copy.
- * @width: The width of the area to copy.
- * @height: The height of the area to copy.
- * @dest_pixbuf: The pixbuf to store the copy in.
- * @dest_x: X coordinate for the upper left corner of the rectangle to draw to in @dest_pixbuf.
- * @dest_y: Y coordinate for the upper left corner of the rectangle to draw to in @dest_pixbuf.
+ * @src_pixbuf: Source pixbuf.
+ * @src_x: Source X coordinate within @src_pixbuf.
+ * @src_y: Source Y coordinate within @src_pixbuf.
+ * @width: Width of the area to copy.
+ * @height: Height of the area to copy.
+ * @dest_pixbuf: Destination pixbuf.
+ * @dest_x: X coordinate within @dest_pixbuf.
+ * @dest_y: Y coordinate within @dest_pixbuf.
  *
- * Takes a rectangle area beginning at (@src_x, @src_y) @width pixels wide
- * and @height pixels high from @src_pixbuf and copy it into @dest_pixbuf
- * at (@dest_x, @dest_y). @dest_pixbuf must already be created and must be
- * large enough to hold the requested area.
- *
- * Return value: void
+ * Copies a rectangular area from @src_pixbuf to @dest_pixbuf.  Conversion of
+ * pixbuf formats is done automatically.
  **/
-void gdk_pixbuf_copy_area(GdkPixbuf *src_pixbuf,
-                         gint src_x, gint src_y,
-                         gint width, gint height,
-                         GdkPixbuf *dest_pixbuf,
-                         gint dest_x, gint dest_y)
+void
+gdk_pixbuf_copy_area (GdkPixbuf *src_pixbuf,
+                     int src_x, int src_y,
+                     int width, int height,
+                     GdkPixbuf *dest_pixbuf,
+                     int dest_x, int dest_y)
 {
-       gint src_width, src_height, dest_width, dest_height;
-
-       /* Ensure that we have a source pixbuf, and that the requested
-        * area is not larger than that pixbuf.
-        */
-       g_return_if_fail(src_pixbuf != NULL);
-
-       src_width = gdk_pixbuf_get_width(src_pixbuf);
-       src_height = gdk_pixbuf_get_height(src_pixbuf);
-
-       g_return_if_fail(src_x >= 0 && width <= src_width);
-       g_return_if_fail(src_y >= 0 && height <= src_height);
-
-       /* Ensure that we have a destination pixbuf, and that the
-        * requested area is not larger than that pixbuf.
-        */
-       g_return_if_fail(dest_pixbuf != NULL);
-
-       dest_width = gdk_pixbuf_get_width(dest_pixbuf);
-       dest_height = gdk_pixbuf_get_height(dest_pixbuf);
-
-       g_return_if_fail(dest_x >= 0 && width <= dest_width);
-       g_return_if_fail(dest_y >= 0 && height <= dest_height);
-
-       /* Scale 1:1 the source pixbuf into the destination pixbuf. */
-       gdk_pixbuf_scale(src_pixbuf,
-                        dest_pixbuf,
-                        dest_x, dest_y,
-                        width, height,
-                        (double)(dest_x - src_x),
-                        (double)(dest_y - src_y),
-                        1., 1., ART_FILTER_NEAREST);
+       ArtPixBuf *src_apb, *dest_apb;
+
+       g_return_if_fail (src_pixbuf != NULL);
+       g_return_if_fail (dest_pixbuf != NULL);
+
+       src_apb = src_pixbuf->art_pixbuf;
+       dest_apb = dest_pixbuf->art_pixbuf;
+
+       g_return_if_fail (src_x >= 0 && src_x + width <= src_apb->width);
+       g_return_if_fail (src_y >= 0 && src_y + height <= src_apb->height);
+
+       g_return_if_fail (dest_x >= 0 && dest_x + width <= dest_apb->width);
+       g_return_if_fail (dest_y >= 0 && dest_y + height <= dest_apb->height);
+
+       /* This will perform format conversions automatically */
+
+       gdk_pixbuf_scale (src_pixbuf,
+                         dest_pixbuf,
+                         dest_x, dest_y,
+                         width, height,
+                         (double) (dest_x - src_x),
+                         (double) (dest_y - src_y),
+                         1.0, 1.0,
+                         ART_FILTER_NEAREST);
 }
index 9b5265bc4933ff90e65e8f6acc92630f9f221799..097c25644bffa9b262e1060c18f7e5c92c20b047 100644 (file)
@@ -147,11 +147,6 @@ void gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf,
                                    GdkRgbDither dither,
                                    int x_dither, int y_dither);
 
-void gdk_pixbuf_render_pixmap (GdkPixbuf        *pixbuf,
-                              GdkPixmap       **pixmap,
-                              GdkBitmap       **mask,
-                              gint              alpha_threshold);
-
 void gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawable,
                                          int src_x, int src_y,
                                          int dest_x, int dest_y,
@@ -161,6 +156,10 @@ void gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawab
                                          GdkRgbDither dither,
                                          int x_dither, int y_dither);
 
+void gdk_pixbuf_render_pixmap_and_mask (GdkPixbuf *pixbuf,
+                                       GdkPixmap **pixmap_return, GdkBitmap **mask_return,
+                                       int alpha_threshold);
+
 /* Fetching a region from a drawable */
 GdkPixbuf *gdk_pixbuf_get_from_drawable (GdkPixbuf *dest,
                                         GdkDrawable *src, GdkColormap *cmap,
@@ -168,12 +167,12 @@ GdkPixbuf *gdk_pixbuf_get_from_drawable (GdkPixbuf *dest,
                                         int dest_x, int dest_y,
                                         int width, int height);
 
-/* Copy an area of a pixbuf into another one */
+/* Copy an area of a pixbuf onto another one */
 void gdk_pixbuf_copy_area (GdkPixbuf *src_pixbuf,
-                          gint src_x, gint src_y,
-                          gint width, gint height,
+                          int src_x, int src_y,
+                          int width, int height,
                           GdkPixbuf *dest_pixbuf,
-                          gint dest_x, gint dest_y);
+                          int dest_x, int dest_y);
 
 /* Scaling */
 
index 5496aeb5dd82d02eb389c396fb270b8fbb9ebd46..742e49c4c846cf7550193afa21bef5c8772c9789 100644 (file)
@@ -170,7 +170,7 @@ remove_alpha (ArtPixBuf *apb, int x, int y, int width, int height, int *rowstrid
  * @dither: Dithering mode for GdkRGB.
  * @x_dither: X offset for dither.
  * @y_dither: Y offset for dither.
- * 
+ *
  * Renders a rectangular portion of a pixbuf to a drawable while using the
  * specified GC.  This is done using GdkRGB, so the specified drawable must have
  * the GdkRGB visual and colormap.  Note that this function will ignore the
@@ -199,7 +199,7 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf,
 
        g_return_if_fail (pixbuf != NULL);
        apb = pixbuf->art_pixbuf;
-       
+
        g_return_if_fail (apb->format == ART_PIX_RGB);
        g_return_if_fail (apb->n_channels == 3 || apb->n_channels == 4);
        g_return_if_fail (apb->bits_per_sample == 8);
@@ -321,69 +321,49 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawable,
 }
 
 /**
- * gdk_pixbuf_render_pixmap:
+ * gdk_pixbuf_render_pixmap_and_mask:
  * @pixbuf: A pixbuf
- * @pixmap: A pointer to a pixmap to fill in.
- * @mask_retval: A pointer to the mask to be filled in.
- * @alpha_threshold: Specifies the threshold value for opacity
- * values if the pixbuf has opacity.
+ * @pixmap_return: Return value for the created pixmap.
+ * @mask_return: Return value for the created mask.
+ * @alpha_threshold: Threshold value for opacity values.
  *
- * Generates a #GdkPixmap from a #GdkPixbuf, along with an optional mask.  The
- * alpha threshold can be used to determine how the mask is created, if the
- * pixbuf has an alpha channel.  This function is mainly provided for
- * compatibility reasons, as you will rarely want a #GdkPixmap.
- * 
+ * Creates a pixmap and a mask bitmap which are returned in the @pixmap_return
+ * and @mask_return arguments, respectively, and renders a pixbuf and its
+ * corresponding tresholded alpha mask to them.  This is merely a convenience
+ * function; applications that need to render pixbufs with dither offsets or to
+ * given drawables should use gdk_pixbuf_render_to_drawable_alpha() or
+ * gdk_pixbuf_render_to_drawable(), and gdk_pixbuf_render_threshold_alpha().
  **/
 void
-gdk_pixbuf_render_pixmap (GdkPixbuf  *pixbuf,
-                         GdkPixmap **pixmap,
-                         GdkBitmap **mask_retval,
-                         gint        alpha_threshold)
+gdk_pixbuf_render_pixmap_and_mask (GdkPixbuf *pixbuf,
+                                  GdkPixmap **pixmap_return, GdkBitmap **mask_return,
+                                  int alpha_threshold)
 {
-       GdkBitmap *mask = NULL;
-
-        g_return_if_fail(pixbuf != NULL);
-
-        /* generate mask */
-        if (gdk_pixbuf_get_has_alpha(pixbuf)) {
-                mask = gdk_pixmap_new(NULL,
-                                      gdk_pixbuf_get_width(pixbuf),
-                                      gdk_pixbuf_get_height(pixbuf),
-                                      1);
-
-                gdk_pixbuf_render_threshold_alpha(pixbuf, mask,
-                                                  0, 0, 0, 0,
-                                                  gdk_pixbuf_get_width(pixbuf),
-                                                  gdk_pixbuf_get_height(pixbuf),
-                                                  alpha_threshold);
-        }
-
-        /* Draw to pixmap */
-        if (pixmap != NULL) {
-                GdkGC* gc;
-
-                *pixmap = gdk_pixmap_new(NULL,
-                                         gdk_pixbuf_get_width(pixbuf),
-                                         gdk_pixbuf_get_height(pixbuf),
-                                         gdk_rgb_get_visual()->depth);
-
-                gc = gdk_gc_new(*pixmap);
-
-                gdk_gc_set_clip_mask(gc, mask);
-
-                gdk_pixbuf_render_to_drawable(pixbuf, *pixmap,
-                                              gc,
-                                              0, 0, 0, 0,
-                                              gdk_pixbuf_get_width(pixbuf),
-                                              gdk_pixbuf_get_height(pixbuf),
-                                              GDK_RGB_DITHER_NORMAL,
-                                              0, 0);
-
-                gdk_gc_unref(gc);
-        }
-
-        if (mask_retval)
-                *mask_retval = mask;
-        else
-                gdk_bitmap_unref(mask);
+       ArtPixBuf *apb;
+
+        g_return_if_fail (pixbuf != NULL);
+
+       apb = pixbuf->art_pixbuf;
+
+       if (pixmap_return) {
+               GdkGC *gc;
+
+               *pixmap_return = gdk_pixmap_new (NULL, apb->width, apb->height,
+                                                gdk_rgb_get_visual ()->depth);
+               gc = gdk_gc_new (*pixmap_return);
+               gdk_pixbuf_render_to_drawable (pixbuf, *pixmap_return, gc,
+                                              0, 0, 0, 0,
+                                              apb->width, apb->height,
+                                              GDK_RGB_DITHER_NORMAL,
+                                              0, 0);
+               gdk_gc_unref (gc);
+       }
+
+       if (mask_return) {
+               *mask_return = gdk_pixmap_new (NULL, apb->width, apb->height, 1);
+               gdk_pixbuf_render_threshold_alpha (pixbuf, *mask_return,
+                                                  0, 0, 0, 0,
+                                                  apb->width, apb->height,
+                                                  alpha_threshold);
+       }
 }